
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form prependId="false">

			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{funcionalidadeEditMB.insert}"
						rendered="#{!funcionalidadeEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.save']}" action="#{funcionalidadeEditMB.update}"
						rendered="#{funcionalidadeEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.delete']}" onclick="confirmation.show()"
						rendered="#{funcionalidadeEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:dialog style="position: absolute; left:50px; top:50px;"  message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.delete']}" severity="alert" widgetVar="confirmation">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{funcionalidadeEditMB.delete}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:dialog>
				</p:toolbarGroup>
			</p:toolbar>

			<br />

			<p:fieldset style="width:98%; -webkit-border-radius: 8px; -moz-border-radius: 8px;border-radius: 8px;" legend="#{messages['funcionalidade.label']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid id="fields" columns="3">
					
					<h:outputLabel value="#{messages['funcionalidade.label.id']}: " for="id" styleClass="text-input" />
					<h:outputText id="id" value="#{funcionalidadeEditMB.bean.id}" />
					<p:message for="id" />
					
					<h:outputLabel value="#{messages['funcionalidade.label.descricao']}: " for="descricao" styleClass="text-input" />
					<h:inputText   onkeypress="if (event.keyCode == 13) { return false; }" id="descricao" value="#{funcionalidadeEditMB.bean.descricao}"
						title="#{messages['funcionalidade.alt.descricao']}" />
					<p:message for="descricao" />
					
					<h:outputLabel value="#{messages['funcionalidade.label.url']}: " for="url" styleClass="text-input" />
					<h:inputText   onkeypress="if (event.keyCode == 13) { return false; }" id="url" value="#{funcionalidadeEditMB.bean.url}"
						title="#{messages['funcionalidade.alt.url']}" />
					<p:message for="url" />
					
					<h:outputLabel value="#{messages['funcionalidade.label.codigo']}: " for="codigo" styleClass="text-input" />
					<h:inputText   onkeypress="if (event.keyCode == 13) { return false; }" id="codigo" value="#{funcionalidadeEditMB.bean.codigo}"
						title="#{messages['funcionalidade.alt.codigo']}" />
					<p:message for="codigo" />
					
				</h:panelGrid>
			</p:fieldset>
		</h:form>
	</ui:define>
</ui:composition>